POV-Ray : Newsgroups : povray.binaries.images : Crockery Jug : Re: Crockery Jug Server Time
1 Aug 2024 08:19:55 EDT (-0400)
  Re: Crockery Jug  
From: Thomas de Groot
Date: 20 Sep 2008 10:08:05
Message: <48d503c5$1@news.povray.org>
"Jim Holsenback" <jho### [at] hotmailcom> schreef in bericht 
news:48d4e73c@news.povray.org...
> Howdy,
>
> I'm working on some objects for a scene that have maker marks or 
> decorations. The swan on this jug is from a photograph of an actual jug in 
> my shop. I used Gimp to play with the color map. I saved the gif image 
> with indexed color map, then I was able to use several transmit statements 
> in my image_map statement to isolate the background and image. Before all 
> this I had developed a texture_map that has some age marks (dents), but 
> when I tried to overlay the swan texture onto the crock texture I ran into 
> a problem (can't overlay a texture over a patterned texture). I was 
> however able to at least get it this far when I removed the dents portion 
> of my texture map. Now my jug looks rather sterile and I'd like to age it 
> up a bit. Any ideas on how to do this?
>

It should be possible to do this in a layered texture. See for instance the 
following example from one of my textures where I added an image_map as the 
uppermost texture layer:

//=====start code====
#declare StoneWall =
texture { // BrickUnderlayer
  pigment {
    brick
    pigment { // Mortar
      granite
      color_map {
        [ 0.0 rgbft <0.3854, 0.3854, 0.3854, 0.0, 0.0> ]
        [ 1.0 rgbft <0.593733, 0.593733, 0.593733, 0.0, 0.0> ]
      }
    }
    pigment { // Brick
      granite
      color_map {
        [ 0.0      rgbft <0.291667, 0.0, 0.0, 0.0, 0.0> ]
        [ 0.355872 rgbft <0.6979, 0.552067, 0.239567, 0.0, 0.0> ]
        [ 1.0      rgbft <1.0, 1.0, 0.7604, 0.0, 0.0> ]
      }
      scale  0.1
    }
    brick_size <2.0, 0.5, 2.0>
    mortar 0.05
    warp {
      turbulence <0.06, 0.06, 0.06>
      octaves 4
    }
  }
  normal {
    brick
    brick_size <2.0, 0.5, 2.0>
    mortar 0.05
    bump_size 1.0
    warp {
      turbulence <0.06, 0.06, 0.06>
      octaves 4
    }
  }
  scale  0.3
  rotate -90.0 * x
  translate <-0.12, 0.15, 0.03>
}
texture { // PlasterCoating
  pigment {
    crackle solid
    pigment_map {
      [ 0.0   color rgbt <0.0, 0.0, 0.0, 1.0> ]
      [ 0.35  color rgbt <0.0, 0.0, 0.0, 1.0> ]
      [ 0.35  granite
              color_map {
                [ 0.0  rgbft <0.416667, 0.343733, 0.177067, 0.0, 0.0> ]
                [ 1.0  rgbft <0.763904, 0.666657, 0.444429, 0.0, 0.0> ]
              }
              scale  0.1
            ]
      [ 0.65  granite
              color_map {
                [ 0.0  rgbft <0.416667, 0.343733, 0.177067, 0.0, 0.0> ]
                [ 1.0  rgbft <0.763904, 0.666657, 0.444429, 0.0, 0.0> ]
              }
              scale  0.1
            ]
      [ 0.65  granite
              color_map {
                [ 0.0  rgbft <0.4479, 0.364567, 0.2604, 0.0, 0.0> ]
                [ 1.0  rgbft <0.770224, 0.696692, 0.604776, 0.0, 0.0> ]
              }
              scale  0.1
            ]
    }
  }
  normal {
    crackle solid
    normal_map {
      [ 0.0 crackle solid //granite , 0.1
            scale  0.1
          ]
      [1.0  crackle solid //granite , 0.1
            scale  0.1
          ]
    }
    bump_size 1.0
  }
  scale  0.6
}
texture { // Dirt
  pigment {
    gradient z
    color_map {
      [ 0.0       rgbft <0.25, 0.1979, 0.1979, 0.0, 0.7> ]
      [ 0.281139  rgbft <0.3229, 0.302067, 0.2604, 0.0, 0.9> ]
      [ 1.0       rgbft <1.0, 1.0, 1.0, 0.0, 1.0> ]
    }
    warp {
      turbulence <0.4, 0.2, 0.3>
    }
  }
  scale  <0.2, 0.1, 5.0>
  translate -0.5 * z
}
texture {
  pigment {
    image_map {
      png "plasma3.png"
      map_type 1   // 0=planar, 1=spherical, 2=cylindrical, 5=torus
      interpolate 2   // 0=none, 1=linear, 2=bilinear, 4=normalized distance
      // once           // for no repetitive tiling
      transmit all 0.7   // N=all or color index # (0...N), V= value 
(0.0...1.0)
    }     // image_map
  }
}


sphere {
  0.0, 1
  texture {StoneWall}
}
//===end code===

If you use a gif as image_map, it should be rather easy to make all colors 
have tranmit 1, except for the swan color which would get transmit 0.

Hope this helps.

Thomas


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.